<?xml version="1.0" encoding="ISO_8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<h:head>
	</h:head>
	
	<h:body>	
		
		 <p:dialog widgetVar="dlgDeleteComponente" modal="true" closable="true" header="#{msg.componente_headerDelete}" >
				<h:form id="formDeleteComponente" name="formDeleteComponente" >
					<h:panelGrid columns="2">					
				 
					 	<h:outputLabel for="Componente" value="Deseja deletar #{componentesMB.componente.nome} ?" />					 	
					 	<h:panelGrid></h:panelGrid>	
					 		
					 	<h:panelGrid></h:panelGrid>				
						<h:panelGrid headerClass="botoes_formulario" columns="2">	
							<p:commandButton value="Deletar" id="botao_deletar_del" ajax="false" action="#{componentesMB.deleteComponente()}" >
							<f:setPropertyActionListener target="#{urlMB.url}" value="componentes.xhtml" />	
							</p:commandButton>
							<p:commandButton value="#{msg.button_cancel}" id="botao_cancelar" ajax="false" />
												
						</h:panelGrid>
						
					</h:panelGrid>					
					
					<h:inputHidden value="#{componentesMB.componente.id}" />
						
				</h:form>				
			</p:dialog>
		
		
		<p:dialog widgetVar="dlgRetirarComponente" modal="true" closable="true" header="#{msg.componente_headerRetirar} #{componentesMB.componente.nome}" >
				<h:form id="formRetirarComponente" name="formRetirarComponente" >
					<h:panelGrid columns="2">					
				 
					 	<h:outputLabel for="Quantidade" value="Quantos deseja retirar?" />
					 	<p:inputText id="Quantidade" value="#{componentesMB.quantidadeDeRetirada}" />					 	
					 	<h:panelGrid></h:panelGrid>	
					 		
					 	<h:panelGrid></h:panelGrid>				
						<h:panelGrid headerClass="botoes_formulario" columns="2">	
							<p:commandButton value="#{msg.button_retirar}" id="botao_retirar" ajax="false" action="#{componentesMB.retirarComponente()}" />
							<p:commandButton value="#{msg.button_cancel}" id="botao_cancelar_retirada" ajax="false" />					
						</h:panelGrid>
						
					</h:panelGrid>
						
				</h:form>				
			</p:dialog>
			
			<p:dialog widgetVar="dlgAddComponente" modal="true" closable="true" header="#{msg.componente_headerAdd} #{componentesMB.componente.nome}" >
				<h:form id="formAddComponente" name="formAddComponente" >
					<h:panelGrid columns="2">					
				 
					 	<h:outputLabel for="Quantidade" value="Quantos deseja adicionar?" />
					 	<p:inputText id="Quantidade" value="#{componentesMB.quantidadeDeRetirada}" />					 	
					 	<h:panelGrid></h:panelGrid>	
					 		
					 	<h:panelGrid></h:panelGrid>				
						<h:panelGrid headerClass="botoes_formulario" columns="2">	
							<p:commandButton value="#{msg.button_add}" id="botao_retirar" ajax="false" action="#{componentesMB.adicionaQuantidade()}" />
							<p:commandButton value="#{msg.button_cancel}" id="botao_cancelar_retirada" ajax="false" />					
						</h:panelGrid>
						
					</h:panelGrid>
						
				</h:form>				
			</p:dialog>
		
		
	</h:body>
</html>